var Sequencer=function(b,a){Object.extend(this,{slideTime:1100||a.slideTime,transitionTime:900||a.transitionTime,reset:undefined||a.reset,sequence:b,current:-1,currentTimeout:undefined,autoPlaying:false,first:true})
};Sequencer.prototype={next:function(b){if(this.current<this.sequence.length-1){this.current++
}else{this.current=0}var a=[];if(b){a.push(b)}if(this.reset&&this.current===this.sequence.length-1){a.push(function(){this.sequence[0].forward(0);
this.current=0});this.sequence[this.current].forward(this.transitionTime,a,this)
}else{this.sequence[this.current].forward(this.first?0:this.transitionTime,a,this);
this.first=false}if(this.autoPlaying){this.currentTimeout=setTimeout(function(){this.next()
}.bind(this),5500)}},prev:function(b){if(this.current===0){this.current=this.sequence.length-1
}else{this.current--}var a=[];if(b){a.push(b)}if(this.reset&&this.current===this.sequence.length-1){this.sequence[this.current].backward(0);
setTimeout(function(){this.sequence[--this.current].backward(this.transitionTime,a,this)
}.bind(this),1)}else{this.sequence[this.current].backward(this.transitionTime,a,this)
}},play:function(){this.autoPlaying=true;this.next()},stop:function(){clearTimeout(this.currentTimeout);
this.autoPlaying=false}};function Slide(a,b){this.seq=a;this.link=b;this.featureLink=$("feature-link")
}Slide.prototype={forward:function(f,d,b){if(d&&b&&f>0){var e=this.seq[this.seq.length-1].el,c=0;
this.seq.each(function(g){if(g.forwardDelay&&g.forwardDelay>0){e=g.el;c=g.forwardDelay
}});var a=function(){d.each(function(g){g.call(b)});e.removeVendorEventListener("transitionEnd",a,false)
};e.addVendorEventListener("transitionEnd",a,false)}this.seq.each(function(g){this.transform(g,"forward",f)
},this);this.featureLink.setAttribute("href",this.link)},backward:function(g,e,b){if(e&&b&&g>0){var f=this.seq[this.seq.length-1].el,c=0;
this.seq.each(function(h){if(h.forwardDelay&&h.forwardDelay>0){f=h.el;c=h.forwardDelay
}});var a=function(){e.each(function(h){h.call(b)});f.removeVendorEventListener("transitionEnd",a,false)
};f.addVendorEventListener("transitionEnd",a,false)}for(var d=this.seq.length-1;
d>=0;d--){this.transform(this.seq[d],"backward",g)}this.featureLink.setAttribute("href",this.link)
},transform:function(b,c,a){b.el.setVendorPrefixStyle("transition",a+"ms cubic-bezier(.51, .01, .37, .98)");
if(b.oX||b.oY){b.el.setVendorPrefixStyle("transformOrigin",this.originString(b.oX,b.oY))
}if(b.opacity!==undefined){b.el.style.opacity=b.opacity}if(b.forwardDelay||b.backwardDelay){b.el.setVendorPrefixStyle("transitionDelay",b[c+"Delay"]+"ms")
}b.el.setVendorPrefixStyle("transform",this.transformString(b.x,b.y,b.r))},transformString:function(b,a,c){c=c?c:0;
return"translate("+b+"px, "+a+"px) rotate("+c+"deg)"},originString:function(a,b){return(a?a:0)+"px "+(b?b:0)+"px"
}};